<?php
defined('IN_TS') or die('Access Denied.');

$giftid = intval($_GET['id']);

//福利信息
$strGift = $new['gift']->find('gift',array(
    'giftid'=>$giftid,
));


if($strGift==''){
    header ( "HTTP/1.1 404 Not Found" );
    header ( "Status: 404 Not Found" );
    $title = '404';
    include pubTemplate ( "404" );
    exit ();
}

if($strGift['count_userdo']==0){
    tsNotice('义卖品尚未售出，暂不能开具证书！');
}


$money = $strGift['price']*$strGift['count_userdo'];

$strGift['title'] = tsTitle($strGift['title']);

$cover =tsXimg($strGift['photo'],'gift',500,'',$strGift['path']);

$strGift['user'] = aac('user')->getOneUser($strGift['userid']);


if(!$strGift['cate']){
    $text='给微澜志愿者的福利：';
}else{
    $text = '为微澜图书馆义卖：';
}

$title = $text.$strGift['title'];
include template("cert");